package com.sgb.kjwl.view.ui.activity.manage

import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.databinding.DataBindingUtil
import com.sgb.capital.base.BaseActivity
import com.sgb.capital.utils.Utils
import com.sgb.capital.view.ui.fragment.OrderFragment
import com.sgb.kjwl.R
import com.sgb.kjwl.databinding.ActivityPayOrderBinding

/**
 * 代办付款
 */
class AgentPayOrderActivity : BaseActivity() {
    private lateinit var mBinding : ActivityPayOrderBinding
    private var fragment: OrderFragment? = null
    companion object{
        fun launch(context: Context){
            val intent = Intent(context, AgentPayOrderActivity::class.java)
            context.startActivity(intent)
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mBinding = DataBindingUtil.setContentView(this, R.layout.activity_pay_order)
        if (savedInstanceState != null) {
            fragment = supportFragmentManager.findFragmentByTag(OrderFragment.TAG) as OrderFragment?
        } else {
            fragment = OrderFragment()
            val bundle = Bundle()
            bundle.putString("data", "待支付")
            fragment!!.arguments = bundle
            supportFragmentManager.beginTransaction().replace(R.id.container, fragment!!, OrderFragment.TAG).commit()
        }
        Utils.setStatusBarLightMode(this, false)
        mBinding.include.ivBack.setOnClickListener { finish() }
        mBinding.include.titleView.text = "待付订单"
    }

    override fun initView() {

    }


}